package com.lcj.odr.db.dao;


import com.lcj.odr.db.pojo.OrderEntity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @author lcj
 */
public interface OrderDao {

    HashMap validCanPayOrder(Map param);

    int updateOrderPrepayId(Map param);

    /**
     * 查询司机端首页订单数据
     * @param driverId
     * @return
     */
    HashMap searchDriverTodayBusinessData(long driverId);

    /**
     * 插入订单
     * @param entity
     * @return row
     */
    int insert(OrderEntity entity);

    /**
     * 根据UUID查询订单ID
     * @param uuid
     * @return ID
     */
    String searchOrderIdByUUID(String uuid);

    /**
     * 司机抢单
     * @param param
     * @return
     */
    int acceptNewOrder(Map param);

    /**
     * 查询执行订单
     * @param param
     * @return
     */
    HashMap searchDriverExecuteOrder(Map param);

    /**
     * 查询订单状态
     * @param param
     * @return
     */
    Integer searchOrderStatus(Map param);

    /**
     * 删除未接单缓存
     * @param param
     * @return
     */
    int deleteUnAcceptOrder(Map param);

    /**
     * 查询司机当前订单
     * @param driverId
     * @return
     */
    HashMap searchDriverCurrentOrder(long driverId);

    /**
     * 查询还未完成的订单id
     * @param customerId
     * @return 订单ID
     */
    Long hasCustomerUnFinishedOrder(long customerId);

    /**
     * 查询还未支付的订单
     * @param customerId
     * @return
     */
    Long hasCustomerUnPayedOrder(long customerId);

    /**
     * 查询未被接单的订单
     * @param customerId
     * @return
     */
    HashMap hasCustomerUnAcceptOrder(long customerId);

    /**
     * 查询订单信息
     * @param param
     * @return
     */
    HashMap searchOrderForMoveById(Map param);

    /**
     * 更新订单状态
     * @param param
     * @return
     */
    int updateOrderStatus(Map param);

    /**
     * 查询订单总数
     * @param param
     * @return orderNumber
     */
    long searchOrderCount(Map param);

    /**
     * 分页查询订单
     * @param param
     * @return orderByPage
     */
    ArrayList<HashMap> searchOrderByPage(Map param);

    /**
     * 查询订单详细信息
     * @param orderId
     * @return Order detail
     */
    HashMap searchOrderContent(long orderId);

    /**
     * 查询30日内上车点
     * @return
     */
    ArrayList<String> searchOrderStartLocationInDays();

    /**
     * 更新订单表实际里程和费用
     * @param param
     * @return
     */
    int updateOrderMileageAndFee(Map param);

    /**
     * 校验订单是否属于该司机
     * @param param
     * @return row number
     */
    long validDriverOwnOrder(Map param);

    /**
     * 查询计算费用所需字段
     * @param orderId
     * @return
     */
    HashMap searchSettlementNeedData(long orderId);

    /**
     * 查询订单和账单信息
     * @param param
     * @return
     */
    HashMap searchOrderById(Map param);

    /**
     * 查询订单司机
     * @param orderId
     * @return
     */
    String searchOrderDriver(long orderId);

    HashMap searchOrderIdAndStatus(long orderId);

    HashMap searchDriverIdAndIncentiveFee(long orderId);

    int updateOrderPayIdAndStatus(Map param);

    int finishOrder(long uuid);

    HashMap searchUuidAndStatus(long orderId);

    int updateOrderAboutPayment(Map param);

    long validDriverAndCustomerOwnOrder(Map param);

    ArrayList<HashMap> searchOrderAndCommentByPage(Map param);

    long searchOrderAndCommentCount(Map param);

}




